
//RAPI Pointers needed
		//CeRapiInit
		typedef HRESULT(CALLBACK* CERAPIINIT)(void);
		
		//CeGetDiskFreeSpaceEx
		typedef int (CALLBACK* CEGETDISKFREESPACEEX)	
		( 
		  LPCWSTR _lpDirectoryName, 
		  PULARGE_INTEGER lpFreeBytesAvailable, 
		  PULARGE_INTEGER lpTotalNumberOfBytes, 
		  PULARGE_INTEGER lpTotalNumberOfFreeBytes
		);
		
		//CeCreateFile
		typedef HANDLE(CALLBACK* CECREATEFILE)
		(
		  LPCWSTR lpFileName, 
		  DWORD dwDesiredAccess, 
		  DWORD dwShareMode, 
		  LPSECURITY_ATTRIBUTES lpSecurityAttributes, 
		  DWORD dwCreationDisposition, 
		  DWORD dwFlagsAndAttributes, 
		  HANDLE hTemplateFile
		); 

		//CeWriteFile
		typedef BOOL (CALLBACK* CEWRITEFILE)
		(
	      HANDLE hFile, 
		  LPCVOID lpBuffer, 
		  DWORD nNumberOfBytesToWrite, 
		  LPDWORD lpNumberOfBytesWritten, 
		  LPOVERLAPPED lpOverlapped
		); 

		//CeDeleteFile
		typedef BOOL (CALLBACK* CEDELETEFILE)
		(
		  LPCWSTR lpFileName
		); 

		typedef BOOL (CALLBACK* CECLOSEHANDLE)
		( 
			HANDLE hObject 
		);

		//CeRapiUninit
		typedef HRESULT (CALLBACK* CERAPIUNINIT)
			(void);

		typedef BOOL (CALLBACK* CECREATEDIRECTORY)(
			LPCWSTR lpPathName,
			LPSECURITY_ATTRIBUTES lpSecurityAttributes
		);



		CERAPIINIT faCeRapiInit;
		CEGETDISKFREESPACEEX faCeGetDiskFreeSpaceEx;
		CECREATEFILE faCeCreateFile;
		CEWRITEFILE faCeWriteFile;
		CEDELETEFILE faCeDeleteFile;
		CECLOSEHANDLE faCeCloseHandle;
		CERAPIUNINIT faCeRapiUninit;
		CECREATEDIRECTORY faCeCreateDirectory;

		HMODULE hRapiInstance = NULL;

bool RapiLoader()
{
	hRapiInstance = NULL;
	faCeRapiInit = NULL;
	faCeGetDiskFreeSpaceEx = NULL;
	faCeCreateFile = NULL;
	faCeWriteFile = NULL;
	faCeDeleteFile = NULL;
	faCeCloseHandle = NULL;
	faCeRapiUninit = NULL;
	faCeCreateDirectory = NULL;

	hRapiInstance = LoadLibrary(_T("Rapi.DLL"));

	if (hRapiInstance!=NULL)
	{
		faCeRapiInit = (CERAPIINIT) GetProcAddress(hRapiInstance,_T("CeRapiInit"));		
		faCeGetDiskFreeSpaceEx = (CEGETDISKFREESPACEEX) GetProcAddress(hRapiInstance,_T("CeGetDiskFreeSpaceEx"));
		faCeCreateFile = (CECREATEFILE)GetProcAddress(hRapiInstance,_T("CeCreateFile"));
		faCeWriteFile = (CEWRITEFILE)GetProcAddress(hRapiInstance,_T("CeWriteFile"));
		faCeDeleteFile = (CEDELETEFILE)GetProcAddress(hRapiInstance,_T("CeDeleteFile"));
		faCeCloseHandle = (CECLOSEHANDLE)GetProcAddress(hRapiInstance,_T("CeCloseHandle"));
		faCeRapiUninit = (CERAPIUNINIT)GetProcAddress(hRapiInstance,_T("CeRapiUninit"));
		faCeCreateDirectory = (CECREATEDIRECTORY)GetProcAddress(hRapiInstance,_T("CeCreateDirectory"));

		if (faCeRapiInit &&
			faCeGetDiskFreeSpaceEx  &&
			faCeCreateFile &&
			faCeWriteFile &&
			faCeDeleteFile &&
			faCeCloseHandle &&
			faCeRapiUninit)
		{
			
			return true;
		}
	}
	return false;

}

void RapiUnloader()
{
	MSG("RapiUnloader");

	if (hRapiInstance)
	{
		if (faCeRapiUninit)
			(*faCeRapiUninit)();


		FreeLibrary(hRapiInstance);

	}
	hRapiInstance = NULL;
	faCeRapiInit = NULL;
	faCeGetDiskFreeSpaceEx = NULL;
	faCeCreateFile = NULL;
	faCeWriteFile = NULL;
	faCeDeleteFile = NULL;
	faCeCloseHandle = NULL;
	faCeRapiUninit = NULL;
	faCeCreateDirectory = NULL;

}